home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
bison
/
bison.dif
< prev
next >
Wrap
Text File
|
1989-02-02
|
8KB
|
298 lines
diff -c /usr/pkg/gnu/src/bison/files.c ./files.c
*** /usr/pkg/gnu/src/bison/files.c Wed Jul 6 08:41:01 1988
--- ./files.c Wed Jan 4 11:46:16 1989
***************
*** 30,35 ****
--- 30,39 ----
#include "new.h"
#include "gram.h"
+ #ifdef __STDC__
+ void *malloc(unsigned);
+ #endif
+
FILE *finput = NULL;
FILE *foutput = NULL;
FILE *fdefines = NULL;
***************
*** 54,59 ****
--- 58,64 ----
char *mktemp(); /* So the compiler won't complain */
FILE *tryopen(); /* This might be a good idea */
+ char *getenv();
extern int verboseflag;
extern int definesflag;
***************
*** 100,109 ****
#ifdef VMS
char *tmp_base = "sys$scratch:b_";
#else
char *tmp_base = "/tmp/b.";
#endif
! int tmp_len = strlen (tmp_base);
if (spec_outfile)
{
/* -o was specified. The precise -o name will be used for ftable.
--- 105,126 ----
#ifdef VMS
char *tmp_base = "sys$scratch:b_";
#else
+ # ifdef MSC5
+ char *tmp_base;
+ # else
char *tmp_base = "/tmp/b.";
+ # endif
+ #endif
+ int tmp_len;
+
+ #ifdef MSC5
+ if ((tmp_base = getenv("TMP")) == NULL) tmp_base="";
#endif
! tmp_len = strlen (tmp_base);
+ #ifdef MSC5
+ strlwr(infile);
+ #endif
if (spec_outfile)
{
/* -o was specified. The precise -o name will be used for ftable.
***************
*** 111,116 ****
--- 128,136 ----
name_base = spec_outfile;
/* BASE_LENGTH includes ".tab" but not ".c". */
base_length = strlen (name_base);
+ #ifdef MSC5
+ strlwr(name_base);
+ #endif
if (!strcmp (name_base + base_length - 2, ".c"))
base_length -= 2;
/* SHORT_BASE_LENGTH includes neither ".tab" nor ".c". */
***************
*** 144,150 ****
base_length -= 2;
short_base_length = base_length;
! #ifdef VMS
name_base = stringappend(name_base, short_base_length, "_tab");
#else
name_base = stringappend(name_base, short_base_length, ".tab");
--- 164,170 ----
base_length -= 2;
short_base_length = base_length;
! #if defined(VMS) || defined(MSC5)
name_base = stringappend(name_base, short_base_length, "_tab");
#else
name_base = stringappend(name_base, short_base_length, ".tab");
***************
*** 154,165 ****
finput = tryopen(infile, "r");
! filename = (char *) getenv ("BISON_SIMPLE");
! fparser = tryopen(filename ? filename : PFILE, "r");
if (verboseflag)
{
outfile = stringappend(name_base, short_base_length, ".output");
foutput = tryopen(outfile, "w");
}
--- 174,201 ----
finput = tryopen(infile, "r");
! if(!(filename = (char *) getenv ("BISON_SIMPLE")))
! #ifdef MSC5 /* file doesn't exist in curent directory, try in INIT directory */
! if(access(PFILE,4) && (cp = getenv("INIT"))) {
! filename = malloc(strlen(cp)+strlen(PFILE)+2);
! strcpy(filename,cp);
! cp = filename+strlen(filename);
! *cp++ = '/';
! strcpy(cp,PFILE);
! }
! else
! #endif
! filename = PFILE;
!
! fparser = tryopen(filename, "r");
if (verboseflag)
{
+ #ifdef MSC5
+ outfile = stringappend(name_base, short_base_length, ".out");
+ #else
outfile = stringappend(name_base, short_base_length, ".output");
+ #endif
foutput = tryopen(outfile, "w");
}
***************
*** 169,185 ****
--- 205,239 ----
fdefines = tryopen(defsfile, "w");
}
+ #ifdef MSC5
+ actfile = mktemp(stringappend(tmp_base, tmp_len, "acXXXXXX"));
+ #else
actfile = mktemp(stringappend(tmp_base, tmp_len, "act.XXXXXX"));
+ #endif
faction = tryopen(actfile, "w+");
+ #ifndef MSC5
unlink(actfile);
+ #endif
+ #ifdef MSC5
+ tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "atXXXXXX"));
+ #else
tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "attrs.XXXXXX"));
+ #endif
fattrs = tryopen(tmpattrsfile,"w+");
+ #ifndef MSC5
unlink(tmpattrsfile);
+ #endif
+ #ifdef MSC5
+ tmptabfile = mktemp(stringappend(tmp_base, tmp_len, "taXXXXXX"));
+ #else
tmptabfile = mktemp(stringappend(tmp_base, tmp_len, "tab.XXXXXX"));
+ #endif
ftable = tryopen(tmptabfile, "w+");
+ #ifndef MSC5
unlink(tmptabfile);
+ #endif
/* These are opened by `done' or `open_extra_files', if at all */
if (spec_outfile)
***************
*** 191,198 ****
--- 245,257 ----
attrsfile = stringappend(name_base, short_base_length, "_stype.h");
guardfile = stringappend(name_base, short_base_length, "_guard.c");
#else
+ # ifdef MSC5
+ attrsfile = stringappend(name_base, short_base_length, ".sth");
+ guardfile = stringappend(name_base, short_base_length, ".guc");
+ # else
attrsfile = stringappend(name_base, short_base_length, ".stype.h");
guardfile = stringappend(name_base, short_base_length, ".guard.c");
+ # endif
#endif
}
***************
*** 204,214 ****
{
FILE *ftmp;
int c;
! char *filename;
/* JF change open parser file */
fclose(fparser);
filename = (char *) getenv ("BISON_HAIRY");
! fparser= tryopen(filename ? filename : PFILE1, "r");
/* JF change from inline attrs file to separate one */
ftmp = tryopen(attrsfile, "w");
--- 263,284 ----
{
FILE *ftmp;
int c;
! char *filename, *cp;
/* JF change open parser file */
fclose(fparser);
filename = (char *) getenv ("BISON_HAIRY");
! #ifdef MSC5 /* file doesn't exist in curent directory, try in INIT directory */
! if(access(PFILE1,4) && (cp = getenv("INIT"))) {
! filename = malloc(strlen(cp)+strlen(PFILE)+2);
! strcpy(filename,cp);
! cp = filename+strlen(filename);
! *cp++ = '/';
! strcpy(cp,PFILE1);
! }
! else
! #endif
! filename = PFILE1;
! fparser= tryopen(filename, "r");
/* JF change from inline attrs file to separate one */
ftmp = tryopen(attrsfile, "w");
***************
*** 283,288 ****
--- 353,365 ----
if (k==0) sys$exit(SS$_NORMAL);
sys$exit(SS$_ABORT);
#else
+ # ifdef MSC5
+ if (actfile) unlink(actfile);
+ if (tmpattrsfile) unlink(tmpattrsfile);
+ if (tmptabfile) unlink(tmptabfile);
+ exit(k);
+ # else
exit(k);
+ # endif
#endif
}
diff -c /usr/pkg/gnu/src/bison/machine.h ./machine.h
*** /usr/pkg/gnu/src/bison/machine.h Fri Dec 19 17:38:40 1986
--- ./machine.h Sat Dec 31 20:35:34 1988
***************
*** 21,26 ****
--- 21,32 ----
#define MAXSHORT 32767
#define MINSHORT -32768
+ #ifdef MSC5
+ #define BITS_PER_WORD 16
+ #define WORDSIZE(n) (((n) + 15) / 16)
+ #define SETBIT(x, i) ((x)[(i)>>4] |= (1<<((i) & 15)))
+ #else
#define BITS_PER_WORD 32
#define WORDSIZE(n) (((n) + 31) / 32)
#define SETBIT(x, i) ((x)[(i)>>5] |= (1<<((i) & 31)))
+ #endif
diff -c /usr/pkg/gnu/src/bison/output.c ./output.c
*** /usr/pkg/gnu/src/bison/output.c Wed Oct 12 05:06:23 1988
--- ./output.c Sat Dec 31 20:35:18 1988
***************
*** 103,110 ****
#include "gram.h"
#include "state.h"
#define MAXTABLE 32767
!
extern int debugflag;
extern int nolinesflag;
--- 103,113 ----
#include "gram.h"
#include "state.h"
+ #ifdef MSC5
+ #define MAXTABLE 16383
+ #else
#define MAXTABLE 32767
! #endif
extern int debugflag;
extern int nolinesflag;
*** /usr/pkg/gnu/src/bison/bison.simple Sun Jan 29 13:40:33 1989
--- ./bison.simple Sun Jan 29 13:43:05 1989
***************
*** 113,118 ****
--- 113,122 ----
It is replaced by the list of actions, each action
as one case of the switch. */
+ #ifndef BSD
+ #define bcopy(s,d,l) memcpy(d,s,l)
+ #endif
+
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2